home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_09
/
1009049a
< prev
next >
Wrap
Text File
|
1992-04-01
|
686b
|
31 lines
/*** LISTING 6 ***/
/*** ***/
/*** sout.c ***/
/*** **************************************** ***/
/*** OUTPUT A CHARACTER TO SERIAL PORT ***/
/*** **************************************** ***/
#include "serial.h"
#include <time.h>
extern int portbase;
int SerialOut (char Char_Value)
{
clock_t start, timeout;
start = (clock());
while((inp(portbase + LSR) & XMTRDY) == 0)
{
timeout = (clock());
if((timeout-start) > 1)
{
return(-1);
}
}
outp(portbase + TXR,Char_Value);
return (0);
}